Skip to content

feat: merge local datasets in the browser - #115

Open
Samuel-Hills wants to merge 3 commits into
huggingface:mainfrom
Samuel-Hills:feat/merge-local-datasets
Open

Samuel-Hills wants to merge 3 commits into
huggingface:mainfrom
Samuel-Hills:feat/merge-local-datasets

Conversation

@Samuel-Hills

Copy link
Copy Markdown

Summary

Adds a local-only workflow for merging two or more existing local LeRobot
datasets from LeLab's Dataset browser.

The source datasets remain unchanged. The merged result is written as a new
local/<name> dataset only after the merge completes successfully.

Included

  • Dataset-browser merge dialog for local datasets
  • Validation for source selection and output names
  • POST /datasets/merge endpoint
  • LeRobot merge_datasets integration
  • Staged output and cleanup on failure
  • Backend and frontend regression tests

Validation

  • uv run pytest tests/test_datasets.py -q — 36 passed
  • uv run ruff check ... — passed
  • npm test — 7 passed
  • Focused frontend ESLint — passed
  • npm run build — passed

Closes #109.

@nicolas-rabault nicolas-rabault left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution! Please address the issues detailed inline and get the required Quality check passing before merge.

Comment thread lelab/datasets.py

source_dirs = [episode_media.resolve_dataset_dir(repo_id) for repo_id in source_repo_ids]
datasets = [
LeRobotDataset(repo_id=repo_id, root=source_dir)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P1] Repair interrupted recordings before opening them. A locally recorded dataset can have readable data and meta/info.json but no meta/episodes index. With the pinned LeRobot v0.6.0, this constructor then attempts a Hub lookup instead of reading the local recording, so a never-uploaded dataset cannot merge. I reproduced this with two tiny real datasets after removing one episode index; the complete-dataset case passes. Call the existing repair_local_dataset helper before constructing each source, handle DatasetRepairError, and add an offline regression case. CLAUDE.md's dataset_repair rule requires this before opening recorded datasets.

Comment thread frontend/src/pages/EditDataset.tsx Outdated
)}
</div>
<MergeDatasetsDialog
datasets={datasets}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] Carry the current dataset selection into the merge flow. The dialog receives no repoId, starts with an empty selection, and the Merge button is available even when no dataset is selected. I verified the latter in the running browser. This makes users pick both sides again instead of choosing what to merge into the dataset they are browsing. Show the action against a selected local dataset, retain that dataset as a source, and ask only for additional sources; cover opening the dialog from a selected dataset.

Comment thread frontend/dist/index.html Outdated
</head>
<body>
<div id="root"></div>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] Commit the exact generated index.html. Rebuilding this head with Node 22 and the locked dependencies changes this file: the committed version has CRLF line endings and an extra blank line after the root div. The required Quality workflow rejects any dirty dist output, even though the JS and CSS hashes match. Regenerate and commit the index without a subsequent formatting or line-ending conversion, then verify the dist freshness check is clean.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: Merge multiple local datasets into one

2 participants